<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <js file="__PUBLIC__/Js/jquery-1.7.2.min.js"/>
    <js file="__PUBLIC__/Js/ghulam.js"/>
    <title></title>
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-9  " style="width: 100%">
            <h3 class="sub-header">管理员列表</h3>
            <a href="{:U(GROUP_NAME.'/Rbac/addUser')}" class="btn btn-primary">添加管理员</a>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>管理员名称</th>
                        <th>管理员真实名称</th>
                        <th>注册时间</th>
                        <th>注册IP</th>
                        <th>锁定状态</th>
                        <th>管理员所属角色</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="user" item="v">
                        <tr>
                            <td>{$v.username}</td>
                            <td>{$v.realname}</td>
                            <td>{$v.logintime|date="Y-m-d H:i:s", ###}</td>
                            <td>{$v.loginip}</td>
                            <td><if condition="$v['lock']"><span class="label label-default">锁定</span><else/><if condition='$v["username"] == C("RBAC_SUPERADMIN")'><span class="label label-default">正常</span><else/><span class="label label-primary">正常</span></if></if></td>
                            <td>
                                <if condition='$v["username"] == C("RBAC_SUPERADMIN")'><span class="label label-default">超级管理员</span><else/>
                                    <ul style="list-style:none;padding:0;margin:0;">
                                        <foreach name="v.role" item="value">
                                            <!--<li>{$value.remark}</li>-->
                                            <li>{$value.remark}</li>
                                        </foreach>
                                    </ul>
                                </if>
                            </td>
                            <td><if condition='$v["username"] == C("RBAC_SUPERADMIN")'>
                                <a href="#" class="btn btn-default btn-danger btn-xs disabled">锁定</a>
                                <elseif condition='$v["lock"]'/>
                                <a href="{:U(GROUP_NAME.'/Rbac/lock',array('id'=>$v['id'],'lock'=>0))}" class="btn button-primary btn-danger btn-xs">解锁</a>
                                <else/><a href="{:U(GROUP_NAME.'/Rbac/lock',array('id'=>$v['id'],'lock'=>1))}" class="btn btn-default btn-danger btn-xs">锁定</a></if></td>
                            <td>
                                <if condition='$v["username"] == C("RBAC_SUPERADMIN")'>
                                    <a href="#" class="btn btn-default btn-danger btn-xs disabled">修改密码</a>
                                    <else/>
                                <a href="{:U(GROUP_NAME.'/Rbac/edit_user_pwd',array('id'=>$v['id']))}" class="btn btn-default btn-danger btn-xs">修改密码</a>
                                    </if>
                            </td>
                            <td>
                                <if condition='$v["username"] == C("RBAC_SUPERADMIN")'>
                                    <a href="#" class="btn btn-default btn-danger btn-xs disabled">删除</a>
                                    <else/>
                                    <a onclick="return del();" href="{:U(GROUP_NAME.'/Rbac/delete',array('id'=>$v['id']))}" class="btn btn-default btn-danger btn-xs">删除</a>
                                </if>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/bootstrap/css/button.css" rel="stylesheet">
<script src="__PUBLIC__/bootstrap/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/bootstrap/js/bootstrap.js"></script>
</body>
</html>